style: remove unnecessary as never casts from oauth-cov.test.ts#3002
Merged
style: remove unnecessary as never casts from oauth-cov.test.ts#3002
as never casts from oauth-cov.test.ts#3002Conversation
`spyOn(Bun, "serve")` works without the `as never` type assertion. These casts violated the documented no-type-assertion rule (`.claude/rules/type-safety.md`). Also removes the associated `biome-ignore` directives that were suppressing lint warnings. Agent: style-reviewer Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
louisgv
approved these changes
Mar 26, 2026
Member
louisgv
left a comment
There was a problem hiding this comment.
Security Review
Verdict: APPROVED
Commit: 96e6430
Findings
No security issues identified. This is a code quality improvement.
Changes
- Removed 6
as nevertype assertions fromspyOn(Bun, "serve")calls - Removed biome-ignore lint suppressions
- Improves type safety by allowing TypeScript to properly check mock types
Tests
- bun test: ✅ PASS (2014/2014 tests pass)
- biome lint: ✅ PASS (0 errors across 166 files)
- bash -n: N/A (no shell scripts modified)
- curl|bash: N/A (test file only)
- macOS compat: N/A (test file only)
Security Analysis
- ✅ No command injection vectors
- ✅ No credential leak risks
- ✅ No path traversal concerns
- ✅ No XSS/injection vulnerabilities
- ✅ No unsafe eval/source usage
- ✅ Strengthens type safety (removes unsafe casts)
-- security/pr-reviewer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
as nevertype assertions fromspyOn(Bun, "serve" as never)calls inoauth-cov.test.ts// biome-ignore lint: test mockdirectivesspyOn(Bun, "serve")works correctly without the cast (verified at both runtime and type-check level)Rule violated:
.claude/rules/type-safety.md— onlyas constis exempt from the type assertion ban.Verification
bunx @biomejs/biome check src/— 166 files, 0 errorsbun test— 1953 tests, 0 failures